package com.xxxxx.server.controller;

import com.xxxxx.server.pojo.Menu;
import com.xxxxx.server.service.IMenuService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author liyan
 * @since 2021-08-19
 */
@RestController
@RequestMapping("/system/config")
public class MenuController {
    @Autowired
    private IMenuService menuService;

    @ApiOperation(value = "通过用户id查询菜单列表")
    @GetMapping("/menu")
    //基于SpringSecurity框架提供的全局对象,用户只要登陆之后会把对象存在服务器,后端会根据用户登录后存储的对象查询
    public List<Menu> getMenusByAdminId() {
        return menuService.getMenusByAdminId();
    }
}
